package com.controller;

import com.util.GlobalVariableUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * description 用户控制器
 * @author 周建泽
 * @date '2023/11/9'
 */
@RestController
@AllArgsConstructor
@RequestMapping("/api")
@Slf4j
public class UserController {

    private GlobalVariableUtil globalVariableUtil;

    /**
     * description 获取所有用户
     * @return  所有用户
     */
    @GetMapping("/test")
    public JSONObject getAllUser(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("dbUrl",globalVariableUtil.getDbUrl());
        jsonObject.put("username",globalVariableUtil.getUsername());
        jsonObject.put("password",globalVariableUtil.getPassword());
        return jsonObject;
    }
}
